﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BySoft.Web.Controls;
using System.Web.UI.HtmlControls;

namespace BySoft.Web.Site.MastePage
{
    public partial class SubEmptyMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public HtmlGenericControl Body
        {
            get
            {
                return body;
            }
            set
            {
                body = value;
            }
        }

        protected void SManager_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
        {
            ScriptManager.GetCurrent(this.Page).AsyncPostBackErrorMessage = e.Exception.Message;
        }


        public string ValidationGroup
        {
            set
            {
                if (!string.IsNullOrEmpty(value))
                {
                    string[] groups = value.Split(',');
                    upInfo.ContentTemplateContainer.Controls.Clear();
                    foreach (string group in groups)
                    {
                        ErrorMessager emsg = new ErrorMessager();
                        emsg.ID = "ErrorMessage_ValidationSummary_" + group;
                        emsg.ValidationGroup = group;
                        upInfo.ContentTemplateContainer.Controls.Add(emsg);

                    }

                }
            }
        }

        public string ValidationGroupDetail
        {
            set
            {
                if (!string.IsNullOrEmpty(value))
                {
                    string[] groups = value.Split(',');
                    upInfo.ContentTemplateContainer.Controls.Clear();
                    foreach (string group in groups)
                    {
                        ErrorMessager emsg = new ErrorMessager();
                        emsg.ID = "ErrorMessage_ValidationSummary_" + group;
                        emsg.ValidationGroup = group;
                        upInfo.ContentTemplateContainer.Controls.Add(emsg);

                    }

                }
            }
        }
    }
}
